{extend name="public/base"}

{block name="title"}就行天下-店铺申请{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/personal.css" />
{css href="__STATIC__/home/css/map.css"}
{js href="__STATIC__/home/css/jquery.jcrop.min.css" /}
<style>
    .select_area {
        position: fixed;
        top: .5rem;
        left: 1rem;
        padding: 0 .7rem;
        background: #36a110;
        color: #fff;
        border-radius: 5px;
        z-index: 10000;
    }
</style>
{/block}

{block name="main"}
<div class="pageControl bg-f5 shopApply">
    <div class="main-top"></div>
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">店铺申请</h1>
        <a href="" class="msui_navTop-right msui_navTop-cnav"><i class="micon-cnav"></i></a>
    </div>
    <div>
        <img src="__STATIC__/home/images/jia9.png" alt="">
    </div>
    <div class="shopApply-title">
        <span>店铺信息</span>
    </div>
    <form action="?" method="post">
        <div class="shopApply-input">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="cl-3333 weui-label">店铺logo</label>
                </div>
                <div class="weui-cell__bd list_img">
                    <img src="{$data.logo|default='__STATIC__/home/images/2.jpg'}" alt="" class="logo">
                    <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="logo" data-quantity="pic" data-width="100" data-height="100"/>
                    <input type="hidden" name="logo" value="{$data.logo|default=''}">
                </div>
            </div>
            <div class="weui-cell bg-ff">
                <div class="weui-cell__hd">
                    <label class="weui-label cl-3333">店铺名称</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="text" class="weui-input" placeholder="请输入店铺名称" name="name" value="{$data.name|default=''}"/>
                </div>
            </div>
            <div class="weui-cell bg-ff">
                <div class="weui-cell__hd">
                    <label class="weui-label cl-3333">店主姓名</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="text" class="weui-input" placeholder="请输入店主姓名" name="shopkeeper" value="{$data.shopkeeper|default=''}"/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label cl-3333">联系电话</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="text" class="weui-input" placeholder="请输入您的电话号码" name="mobile" value="{$data.mobile|default=''}"/>
                </div>
            </div>
            <div class="weui-cell address2">
                <div class="weui-cell__hd">
                    <label class="weui-label cl-3333">店铺地址</label>
                </div>
                <div class="weui-cell__bd show_friend_map">
                    <p class="activity_address">正在获取地址...</p>
                    <input type="hidden" class="weui-input" placeholder="请输入活动的详细地址" name="address" data-error="请选择活动详细地址">
                    <input type="hidden" name="lat" value="{$data.lat|default=''}" data-error="请选择活动详细地址"/>
                    <input type="hidden" name="lng" value="{$data.lng|default=''}" data-error="请选择活动详细地址"/>
                </div>
                <div class="weui-cell__ft">
                    <img src="__STATIC__/home/images/address2.png" alt="">
                </div>
            </div>
        </div>
        <div class="shopApply-title">
            <span>证件信息</span>
        </div>
        <div class="shopApply-input">
            <div class="weui-cell bg-ff">
                <div class="weui-cell__hd">
                    <label class="weui-label cl-3333">营业执照</label>
                </div>
                <div class="weui-cell__bd">
                    <input type="text" class="weui-input" placeholder="请输入营业执照的注册号" name="business_license_number" value="{$data.business_license_number|default=''}"/>
                </div>
            </div>
            <div class="weui-sell_card bg-fff">
                <div class="weui-cell__hd">
                    <label class="weui-label weui-label1 cl-3333">营业执照照片</label>
                </div>
                <div class="shop_card_img_a">
                    <img src="{$data.business_license_image|default='__STATIC__/home/images/shop_ying_03.png'}" alt="" class="business_license_image"/>
                    <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="business_license_image" data-quantity="pic" data-width="290" data-height="200"/>
                    <input type="hidden" name="business_license_image" value="{$data.business_license_image|default=''}">
                </div>
            </div>
            <div class="weui-sell_card bg-fff">
                <div class="weui-cell__hd">
                    <label class="weui-label weui-label1 cl-3333">经营许可证</label>
                </div>
                <div class="shop_card_img_a">
                    <img src="{$data.business_license_image|default='__STATIC__/home/images/shop_ying_03.png'}" alt="" class="business_certificate"/>
                    <input class="uploaderInput weui-uploader__input" type="file" accept="image/*" data-field="business_certificate" data-quantity="pic" data-width="290" data-height="200"/>
                    <input type="hidden" name="business_certificate" value="{$data.business_certificate|default=''}">
                </div>
            </div>
        </div>
        <input type="hidden" name="id" value="{$data.id|default=0}" />
    </form>
    <div class="presentBtn-bg">
        <a href="javascript:;" class="presentBtn cl-f text-center bg-c40 send_form">提交申请</a>
    </div>
    <div class="shopApply-bottom">
        <img src="__STATIC__/home/images/jia5.png" alt="">
    </div>
</div>
<div id="show_map" class="weui-popup__container">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="main-top"></div>
        <div class="msui_nav msui_navTop">
            <h1 class="msui_navTop-title">选择活动地址</h1>
        </div>
        <div class="map_address fs065" style="top: 3rem;">定位中...</div>
        <div id="map" style="height: 100%;"></div>
        <a class="close-popup select_area" href="javascript:;" >确定</a>
    </div>
</div>
{/block}

{block name="javascript"}
{js href="__STATIC__/home/js/jquery.jcrop.min.js" /}
{js href="__STATIC__/home/js/jquery.jcrop.upload.js" /}
{js href="__STATIC__/home/js/exif.js" /}
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=79d3994d99486314dbfddc26b4445dd2&plugin=AMap.ToolBar"></script>
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.10"></script>
<script src="__STATIC__/home/js/map.js?v={php} echo time();{/php}"></script>

<script>
    SCOPE.upload_img_type = 3;
    $(function () {
        $(".send_form").click(function () {
            $.showLoading('正在提交。。');
            var _form = $('form');
            $.ajax({
                type : _form.attr('method'),
                url : _form.attr('action'),
                data : _form.serialize(),
                dataType : 'json',
                success : function (msg) {
                    if (msg.code == 200) {
                        window.location.href = "{:url('index')}";
                    } else{
                        $.hideLoading();
                        $.toptip(msg.msg);
                    }
                }
            });
        });
    });
</script>
{/block}